package org.aeon.gamechatnest.mapper;

import org.aeon.gamechatnest.pojo.TestEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Repository;

/**
 * @author: MissingAeon
 * @date: 2024/5/8 13:37
 * @description: 测试实体映射接口
 */
@Mapper
public interface TestEntityMapper {
    /**
     * 添加
     *
     * @param testEntity
     * @return
     */
    int add(TestEntity testEntity);

    /**
     * 删除
     *
     * @param id
     * @return
     */
    @Delete("delete from test where id = #{id}")
    int deleteById(@Param("id") Long id);

    /**
     * 查询一个根据id
     *
     * @param id
     * @return
     */
    @Select("select * from test where id = #{id}")
    TestEntity getById(Long id);

    /**
     * 全量修改
     *
     * @param testEntity
     * @return
     */
    int update(TestEntity testEntity);
}
